home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / FADER / ABOUT.C next >
Text File  |  1991-03-01  |  2KB  |  114 lines

  1. /* *******************************
  2.  
  3. File: About.c
  4. Function: Handle all operations for this Modal Dialog
  5. History: 3/1/91 Original by Prototyper.  
  6.  
  7. ******************************* */
  8.  
  9. #include "About.h"
  10.  
  11. static pascal char  MyFilter (DialogPtr   theDialog,  EventRecord   *theEvent,  short  *itemHit);
  12.  
  13. static void  Refresh_Dialog(DialogPtr    GetSelection);
  14.  
  15.  
  16.     /* *********************************** */
  17.     /* These are the other includes for general routines */
  18.  
  19. #include "Strings.h"
  20.     extern char * strcpy(Str255 *, char *);
  21.  
  22.     /* *********************************** */
  23.  
  24. #define      TRUE   1
  25. #define      FALSE  0
  26. #define      NIL    0
  27.  
  28.     /* *********************************** */
  29.  
  30.  
  31.  
  32.  
  33. #define  I_OK   1
  34. #define  I_x   2
  35. #define  I_x3   3
  36. static char   ExitDialog; 
  37. static char   DoubleClick; 
  38. static Point   myPt; 
  39. /* ======================================================== */
  40.  
  41. /* This is an update routine for non-controls in the dialog */ 
  42. /* This is executed after the dialog is uncovered by an alert */ 
  43. static void  Refresh_Dialog(GetSelection) 
  44. DialogPtr    GetSelection;
  45.     Rect    tempRect;
  46.     short    DType;
  47.     Handle    DItem;
  48.     ControlHandle    CItem;
  49.  
  50.     GetDItem(GetSelection,I_OK, &DType, &DItem, &tempRect);
  51.     PenSize(3, 3);
  52.     InsetRect(&tempRect, -4, -4);
  53.     FrameRoundRect(&tempRect, 16, 16); 
  54.     PenSize(1, 1); 
  55.     
  56.  
  57. /* ======================================================== */
  58.  
  59.  
  60. void   D_About()
  61. {
  62.     DialogPtr    GetSelection;
  63.     Rect    tempRect;
  64.     short    DType;
  65.     short    Index;
  66.     Handle    DItem;
  67.     ControlHandle    CItem, CTempItem;
  68.     Str255    sTemp;
  69.     short    itemHit;
  70.     short    temp;
  71.     Handle   Icon_Handle;
  72.     Point  NewMouse; 
  73.     char   InIcon; 
  74.     TEHandle   ThisEditText; 
  75.     DialogPeek   TheDialogPtr;
  76.      
  77.     GetSelection = GetNewDialog(2, NIL, (WindowPtr)-1);
  78.     ShowWindow(GetSelection);
  79.     SelectWindow(GetSelection);
  80.     SetPort(GetSelection);
  81.      
  82.      
  83.     /* Setup initial conditions */
  84.     Refresh_Dialog(GetSelection); 
  85.      
  86.     ExitDialog = FALSE; 
  87.      
  88.     do
  89.     {
  90.         ModalDialog(NIL, &itemHit); 
  91.         GetDItem(GetSelection, itemHit, &DType, &DItem, &tempRect);
  92.         CItem = (ControlHandle)DItem; 
  93.          
  94.         /* Handle it real time */
  95.         if (itemHit == I_OK )
  96.         {
  97.             /* ?? Code to handle this button goes here */
  98.             ExitDialog =TRUE;
  99.         }
  100.         
  101.          
  102.     } 
  103.     while (ExitDialog == FALSE);
  104.      
  105.     /* Get results after dialog */
  106.     
  107.     DisposDialog(GetSelection); 
  108.     
  109. }
  110.  
  111.  
  112.